<?php
	include 'common.php';
	error_reporting(0);
	session_start();
	$loginCorrect = $_GET['loginInfo'];	
	$timezone_offset = 6; // for getting local time offset hrs
	$systemDate = gmdate('y-m-d', time()+$timezone_offset*60*60);
	$systemTime = gmdate('H:i:s', time()+$timezone_offset*60*60);
	$eid = $_SESSION['id'];
	$sql = "UPDATE attendance SET out_time = '$systemTime' WHERE e_id = '$eid' AND date='$systemDate'";
	$sqlQuery = mysql_query($sql);		
	$updateInTheOfficeData = "UPDATE attendance SET inTheOffice='false' WHERE e_id='$eid' and date='$systemDate'";
	$updateInTheOfficeDataQuery = mysql_query($updateInTheOfficeData);	
	session_destroy(); //exit;

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="index.css" type="text/css" />
<link rel="icon" type="image/ico" href="images/favicon.ico"></link> 
<link rel="shortcut icon" href="images/favicon.ico"></link>
<script src="curvycorners.src.js" type="text/javascript"></script>
<script src="login.js" type="text/javascript"></script>
<script type="text/javascript">
function submitform()
{
  document.login_form.submit();
}
</script>
<title>Welcome To Creato</title>
</head>

<body>

<div class="main_div_index">
	<div class="cartoon_inside">
    	<p id="creatobd">www.creatobd.com</p>
        <p id="date"><script>document.write(new_month+" "+new_date+", "+old_date.getFullYear()+" || "+new_day);</script></p>
		<form name="login_form" action="attd.php" method="post">
			<p>user name</p>
			<p><input type="text" name="uname" /></p>
			<p>password</p>
			<p><input type="password" name="pass" /></p>
			<p><input type="submit" class="login_input_button" value="" onclick="javascript: submitform()"/></p>
		</form>
		<p><?php
			if ($loginCorrect == 'false') echo "Invalid Username or Password...";
		?></p>
    </div><!-- end of cartoon_inside-->
    
</div><!-- end of main_div_index-->

<div class="human_portal">

  		<p>creato human resourse portal</p>
</div><!-- end of human_portal-->
</body>
</html>
